package com.example.databindingdemo;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.LinearLayoutManager;

import android.os.Bundle;


import com.example.databindingdemo.databinding.ActivityMain2Binding;

import java.util.ArrayList;
import java.util.List;

public class MainActivity2 extends AppCompatActivity {
private ActivityMain2Binding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,R.layout.activity_main2);
        List<Idol> idols = new ArrayList<>();
        for (int i = 0; i < 15; i++) {
            idols.add(new Idol("chname"+i,"enname"+i,""));
        }
        RyAdapter adapter = new RyAdapter(idols);
        binding.ry.setLayoutManager(new LinearLayoutManager(this));
        binding.ry.setAdapter(adapter);
    }
}